﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SWDataDB.BLL;
using System.Data;

public partial class UserControl_ZKQuery : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    private void GetContent(string Title)
    {
        QDAdvanceQuery qdquery = new QDAdvanceQuery();
        string strFileID = this.FileID.Text;
        string strtitleName = Request.Form["titleName"];
        string strPMCODE = Request.Form["PMCODE"];
        string strPMName = Request.Form["PMName"];
        string strPMQuality = Request.Form["PMQuality"];
        string strPMScale = Request.Form["PMScale"];
        string strPMSLON1 = Request.Form["PMSLON1"];
        string strPMSLON2 = Request.Form["PMSLON2"];
        string strPMSLAT1 = Request.Form["PMSLAT1"];
        string strPMSLAT2 = Request.Form["PMSLAT2"];




        //dl_FileList.DataSource = qdquery.PMInfoQuery(strFileID, strtitleName, strPMCODE, strPMName, strPMQuality, strPMScale, strPMSLON1, strPMSLON2, strPMSLAT1, strPMSLAT2);
        //dl_FileList.DataBind();


        DataSet ds = qdquery.PMInfoQuery(strFileID, strtitleName, strPMCODE, strPMName, strPMQuality, strPMScale, strPMSLON1, strPMSLON2, strPMSLAT1, strPMSLAT2);
        DataTable dt = ds.Tables[0];
        DataView dv = dt.DefaultView;
        //对用于分页的类的引用
        PagedDataSource pds = new PagedDataSource();
        pds.DataSource = dt.DefaultView;//设置数据源(DataTable类型)
        pds.AllowPaging = true;


        AspNetPager1.RecordCount = dv.Count;
        pds.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1;
        pds.PageSize = AspNetPager1.PageSize;
        dl_FileList.DataSource = pds;
        dl_FileList.DataBind();


    }

    protected void SearchBtn_Click(object sender, ImageClickEventArgs e)
    {
        //QDAdvanceQuery qdquery = new QDAdvanceQuery();
        //dl_FileList.DataSource = qdquery.PMInfoQuery(null, null, null, null, null, null, null, null, null, null);
        //dl_FileList.DataBind();
        GetContent("");
        FileList.Attributes["style"] = "display:''";
    }

    protected void AspNetPager1_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e)
    {
        AspNetPager1.CurrentPageIndex = e.NewPageIndex;
        GetContent("");
    }
}
